-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
declare that "///" is still a doc comment, just not "////+" (fixes #5838) #6680
Conversation
My backup plan would have been to lex multiple line doc comments with only non- This is (I think) my first non-docs non-examples non-formatting pull request, please bear with me if I'm doing it wrong. Tests still pass and it seems to work out and there's some amount of generated docs that are better formatted/have better summary vs rest of info splits, and no formatting 'regressions' that I could spot. |
This is good. @brson r? |
There's currently a function in the lexer that rejects a line comment that is all slashes from being a doc comment. I think the intention was that you could draw boxes, ///////////// // like so // ///////////// Since a line doc comment split up over multiple paragraphs will have a "blank" line that is just /// between the paragraphs, that would get mistaken for a box segment, lexed as a regular comment, and go missing from the sequence of doc comment attributes before they were reassembled by rustdoc into markdown input. I figure the best plan here is to just declare that a comment that is exactly `///` is a doc comment after all, and to only omit comments with four slashes or more, which is what this commit implements. Can't really draw boxes that narrow, anyway.
…lip1995 Refactor: arrange transmute lints This PR arranges `transmute` lints so that they can be accessed more easily. Basically, I followed the instruction described in rust-lang#6680 as to how to do the refactoring. - `declare_clippy_lint!` and `impl LintPass` is placed in `transmute/mod.rs` - Uitlity functions is placed in `transmute/utils.rs` - Each lint function about `transmute` is moved into its own module, like `transmute/useless_transmute.rs` For ease of review, I refactored step by step, keeping each commit small. For instance, all I did in 2451781 was to move `useless_transmute` into its own module. --- changelog: Refactor `transmute.rs` file into `transmute` module.
Refactor: arrange lints in `methods` module This PR arranges methods lints so that they can be accessed more easily. Basically, I refactored them following the instruction described in rust-lang#6680. changelog: Move lints in methods module into their own modules.
…le, r=phansch Refactor lints in methods module This PR refactors methods lints other than the lints I refactored in rust-lang/rust-clippy#6826 and moves some functions to methods/utils.rs. Basically, I follow the instruction described in rust-lang#6680. **For ease of review, I refactored step by step, keeping each commit small.** closes rust-lang/rust-clippy#6886 cc: `@phansch,` `@flip1995,` `@Y-Nak` changelog: Move lints in methods module to their own modules and some function to methods/utils.rs.
Organize functions into functions module Ref: rust-lang#6680 Rearrange lints in `functions`. changelog: none
…llogiq Refactor: arrange lints in misc_early module This PR arranges misc_early lints so that they can be accessed more easily. Basically, I refactored them following the instruction described in rust-lang#6680. cc: `@Y-Nak,` `@flip1995,` `@magurotuna` changelog: Move lints in misc_early module into their own modules.
Split matches Part of rust-lang#6680 changelog: None
There's currently a function in the lexer that rejects a line comment that is all slashes from being a doc comment. I think the intention was that you could draw boxes,
Since a line doc comment split up over multiple paragraphs will have a "blank" line that is just /// between the paragraphs, that would get mistaken for a box segment, lexed as a regular comment, and go missing from the sequence of doc comment attributes before they were reassembled by rustdoc into markdown input.
I figure the best plan here is to just declare that a comment that is exactly
///
is a doc comment after all, and to only omit comments with four slashes or more, which is what this commit implements. Can't really draw boxes that narrow, anyway.